<template>
  <div :class="prefixCls" class="h-[100%] relative <xl:bg-transparent <sm:px-10px <xl:px-10px <md:px-10px">
    <div class="relative h-full flex mx-auto">
      <div :class="`${prefixCls}__left flex-1 bg-opacity-20 relative p-30px <xl:hidden`">
        <div class="flex justify-center items-center h-[calc(100%-60px)]">
          <TransitionGroup appear enter-active-class="animate__animated animate__bounceInLeft" tag="div">
            <div key="3" class="mt-5 font-normal text-white text-14px">
              {{ t('login.message') }}
            </div>
          </TransitionGroup>
        </div>
      </div>
      <div class="flex-1 p-30px <sm:p-10px relative">
        <!-- 右上角的主题、语言选择 -->
        <div class="flex justify-between items-center text-white @2xl:justify-end @xl:justify-end">
          <div class="flex items-center @2xl:hidden @xl:hidden"> </div>
        </div>
        <!-- 右边的登录界面 -->
        <Transition appear enter-active-class="animate__animated animate__bounceInRight">
          <div
            class="h-full flex items-center m-auto w-[100%] @2xl:max-w-500px @xl:max-w-500px @md:max-w-500px @lg:max-w-500px">
            <!-- 账号登录 -->
            <LoginForm :isShow="true" class="p-20px h-auto m-auto <xl:(rounded-3xl light:bg-white)" />
            <!-- 手机登录 -->
            <MobileForm class="p-20px h-auto m-auto <xl:(rounded-3xl light:bg-white)" />
            <!-- 二维码登录 -->
            <QrCodeForm class="p-20px h-auto m-auto <xl:(rounded-3xl light:bg-white)" />
            <!-- 注册 -->
            <RegisterForm class="p-20px h-auto m-auto <xl:(rounded-3xl light:bg-white)" />
            <!-- 三方登录 -->
            <SSOLoginVue class="p-20px h-auto m-auto <xl:(rounded-3xl light:bg-white)" />
          </div>
        </Transition>
      </div>
    </div>
  </div>
</template>
<script lang="ts" name="Login" setup>
import { useDesign } from '@/hooks/web/useDesign'
import { LoginForm, MobileForm, QrCodeForm, RegisterForm, SSOLoginVue } from './components'

const { t } = useI18n()
const { getPrefixCls } = useDesign()
const prefixCls = getPrefixCls('login')
</script>

<style lang="scss" scoped>
$prefix-cls: #{$namespace}-login;

.#{$prefix-cls} {
  &__left {
    &::before {
      position: absolute;
      top: 0;
      left: 0;
      z-index: -1;
      width: 100%;
      height: 100%;
      background-image: url('@/assets/imgs/login-bg.png');
      background-position: center;
      background-repeat: no-repeat;
      content: '';
    }
  }
}
</style>
